﻿using System;
using System.Collections.Generic;
using AnyLink.Domain.Enums;
using Newtonsoft.Json;
using SqlSugar;

namespace AnyLink.Domain.Entities.System
{
    /// <summary>
    /// 部门表
    /// </summary>
    [SugarTable("sys_dept", TableDescription = "部门表", IsDisabledUpdateAll = true)]
    public class SysDept : BaseAuditedEntity<long>
    {
        /// <summary>
        /// 部门id
        /// </summary>
        [SugarColumn(ColumnName = "dept_id", IsPrimaryKey = true, ColumnDescription = "部门id")]
        [JsonProperty(propertyName: "deptId")]
        public override long Id { get; set; }

        /// <summary>
        /// 父部门id
        /// </summary>
        [SugarColumn(ColumnName = "parent_id", ColumnDescription = "父部门id", IsNullable = true)]
        public long ParentId { get; set; }

        /// <summary>
        /// 祖级列表
        /// </summary>
        [SugarColumn(ColumnName = "ancestors", ColumnDataType = "VARCHAR(50)", ColumnDescription = "祖级列表", IsNullable = true)]
        public string Ancestors { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        [SugarColumn(ColumnName = "dept_name", ColumnDataType = "VARCHAR(30)", ColumnDescription = "部门名称", IsNullable = true)]
        public string DeptName { get; set; }

        /// <summary>
        /// 显示顺序
        /// </summary>
        [SugarColumn(ColumnName = "order_num", ColumnDescription = "显示顺序", IsNullable = true)]
        public int OrderNum { get; set; }

        /// <summary>
        /// 负责人
        /// </summary>
        [SugarColumn(ColumnName = "leader", ColumnDataType = "VARCHAR(20)", ColumnDescription = "负责人", IsNullable = true)]
        public string Leader { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [SugarColumn(ColumnName = "phone", ColumnDataType = "VARCHAR(11)", ColumnDescription = "联系电话", IsNullable = true)]
        public string Phone { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [SugarColumn(ColumnName = "email", ColumnDataType = "VARCHAR(50)", ColumnDescription = "邮箱", IsNullable = true)]
        public string Email { get; set; }

        /// <summary>
        /// 部门状态（0正常 1停用）
        /// </summary>
        [SugarColumn(ColumnName = "status", ColumnDescription = "部门状态（0正常 1停用）", IsNullable = true)]
        public StatusEnum Status { get; set; }

        /// <summary>
        /// 删除标志（0代表存在 2代表删除）
        /// </summary>
        [SugarColumn(ColumnName = "del_flag", ColumnDescription = "删除标志（0代表存在 2代表删除）", IsNullable = true)]
        public DelFlagEnum DelFlag { get; set; }        
    }
}